<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <script>
                function title() {
                    document.getElementById('atendimento').className='selected';
                }
                window.onload=title;
            </script>
            <h:form id="customerCreate" enctype="multipart/form-data">
                <h1 class="title">
                    <a href="#" class="back" onclick="history.go(-1)"/>
                    Tratamentos Realizados
                </h1>
                <p:messages showDetail="true" autoUpdate="true"  /> 
                <div class="row">
                    <div class="twelve columns"> 
                        <fieldset>
                            <legend><h4><h:outputText  value="#{managerOdontograma.customer.gender eq 'MASCULINO' ? 'Sr. ':'Sra. '}#{managerOdontograma.customer.name}#{managerOdontograma.age ne '0' ? ' - ' : ''}#{managerOdontograma.age ne '0' ? managerOdontograma.age : ''}#{managerOdontograma.age ne '0' ? ' Anos' : ''}"/></h4></legend>
                            <p:panel style="background: none; border: none; margin-top: -30px;" 
                                     styleClass="container_24 clearfix">

                                <p:outputLabel value="Estado Civil:" styleClass="grid_5"/>
                                <h:outputText styleClass="grid_12" value="#{managerOdontograma.customer.civilStatus.name}"/>
                                <div class="clear"></div>
                                <p:outputLabel value="E-mail:" styleClass="grid_5"/>
                                <h:outputText styleClass="grid_12" value="#{managerOdontograma.customer.email}"/>
                                <div class="clear"></div>
                                <p:outputLabel value="Telefone:" styleClass="grid_5"/>
                                <h:outputText styleClass="grid_6" value="#{managerOdontograma.customer.phone}"/>
                                <p:outputLabel value="Celular:" styleClass="grid_5"/>
                                <h:outputText styleClass="grid_6" value="#{managerOdontograma.customer.cellular}"/>

                            </p:panel>
                        </fieldset>
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Histórico</h4></legend>
                            <p:panel id="resultPanel" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix " >

                                <p:button value="Novo Odontograma" styleClass="ui-priority-primary right grid_5" 
                                                 icon="ui-icon-plus" >
                                    <f:param name="r" value="3" />
                                </p:button>
                                
                                <p:dataTable id="tablePac" var="pac" value="#{managerSearchCustomer.searchCustomers}" 
                                             styleClass="grid_24"
                                             rowIndexVar="rowid"
                                             rowKey="#{r.id}"
                                             rows="5" paginator="true"  
                                             paginatorPosition="bottom"
                                             emptyMessage="Nenhum registro"
                                             >  
                                    <f:facet name="header">
                                        Odontogramas
                                    </f:facet>
                                    <p:column headerText="Ação" width="75">
                                        <p:button icon="ui-icon-pencil" title="Editar dados do Paciente" alt="Editar dados do Paciente"
                                                  href="editcustomer.xhtml?customerEdit=#{pac.id}" 
                                                  style="width: 25px; position: relative;"/>
                                        <p:button icon="ui-icon-search"  title="Visualizar dados do Paciente" alt="Visualizar dados do Paciente"
                                                  href="showcustomer.xhtml?customerShow=#{pac.id}" 
                                                  style="width: 25px; position: relative"/>

                                    </p:column>
                                    <p:column headerText="Tipo" width="400">  
                                        <h:outputText value=""/>
                                    </p:column>  
                                    <p:column headerText="Realizado em" width="400">  
                                        <p:calendar id="date" showOn="button" styleClass="grid_5" 
                                                    value="#{managerOdontograma.income.createAt}"
                                                    pattern="dd/MM/yyyy" locale="pt"/>  
                                    </p:column>
                                    <p:column headerText="Observações" width="400">  
                                        <h:outputText value=""/>
                                    </p:column>  


                                </p:dataTable> 
                            </p:panel>
                        </fieldset>
                    </div>
                </div>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
